<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>My Project: M:/移动硬盘/曹健/DX3D完成作业/619/D3DX封装/src/Utility.cpp 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">My Project
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.9.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="pages.html"><span>相关页面</span></a></li>
      <li><a href="annotated.html"><span>类</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>文件列表</span></a></li>
      <li><a href="globals.html"><span>文件成员</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">宏定义</a> &#124;
<a href="#func-members">函数</a>  </div>
  <div class="headertitle">
<div class="title">Utility.cpp 文件参考</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="stdafx_8h_source.html">stdafx.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="_utility_8h_source.html">Utility.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
宏定义</h2></td></tr>
<tr class="memitem:a1ac41480eb2e4aadd52252ee550b630a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_utility_8cpp.html#a1ac41480eb2e4aadd52252ee550b630a">new</a>&#160;&#160;&#160;VNEW</td></tr>
<tr class="separator:a1ac41480eb2e4aadd52252ee550b630a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:abd4f051b5c55f6a69432683d9bccca57"><td class="memItemLeft" align="right" valign="top">D3DXVECTOR3&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_utility_8cpp.html#abd4f051b5c55f6a69432683d9bccca57">Vec3Mutiply</a> (const D3DXVECTOR3 &amp;v1, const D3DXVECTOR3 &amp;v2)</td></tr>
<tr class="separator:abd4f051b5c55f6a69432683d9bccca57"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0fdabd0beb44a7b2c364177bb9821d6a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_utility_8cpp.html#a0fdabd0beb44a7b2c364177bb9821d6a">Vec3Perpendicular</a> (D3DXVECTOR3 &amp;out, const D3DXVECTOR3 &amp;src)</td></tr>
<tr class="separator:a0fdabd0beb44a7b2c364177bb9821d6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1cc6a4b6b03e91d140dcfb765a7c2533"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_utility_8cpp.html#a1cc6a4b6b03e91d140dcfb765a7c2533">RandomDeviant</a> (D3DXVECTOR3 &amp;result, const D3DXVECTOR3 &amp;dir, float fAngle)</td></tr>
<tr class="separator:a1cc6a4b6b03e91d140dcfb765a7c2533"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a96590e9d63b919db75f70bb0070dcbe5"><td class="memItemLeft" align="right" valign="top">FORCEINLINE float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_utility_8cpp.html#a96590e9d63b919db75f70bb0070dcbe5">asm_rand</a> ()</td></tr>
<tr class="separator:a96590e9d63b919db75f70bb0070dcbe5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a745ad91c072b53c792f1119644761e2f"><td class="memItemLeft" align="right" valign="top">FORCEINLINE float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_utility_8cpp.html#a745ad91c072b53c792f1119644761e2f">asm_rand_max</a> ()</td></tr>
<tr class="separator:a745ad91c072b53c792f1119644761e2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8222f6aabf6852a2ba89366555d849ca"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_utility_8cpp.html#a8222f6aabf6852a2ba89366555d849ca">UnitRandom</a> ()</td></tr>
<tr class="separator:a8222f6aabf6852a2ba89366555d849ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e5a32131b529a419ed731bffcb50d97"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_utility_8cpp.html#a5e5a32131b529a419ed731bffcb50d97">RangeRandom</a> (float fLow, float fHigh)</td></tr>
<tr class="separator:a5e5a32131b529a419ed731bffcb50d97"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afaa18e13379c2cfc10093b2cde5e4342"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_utility_8cpp.html#afaa18e13379c2cfc10093b2cde5e4342">SymmetricRandom</a> ()</td></tr>
<tr class="separator:afaa18e13379c2cfc10093b2cde5e4342"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a711aca21b00164c4824b0bf58792aba7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_utility_8cpp.html#a711aca21b00164c4824b0bf58792aba7">ChangeFileNameToDDS</a> (string &amp;name)</td></tr>
<tr class="separator:a711aca21b00164c4824b0bf58792aba7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">宏定义说明</h2>
<a class="anchor" id="a1ac41480eb2e4aadd52252ee550b630a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define new&#160;&#160;&#160;VNEW</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">函数说明</h2>
<a class="anchor" id="a96590e9d63b919db75f70bb0070dcbe5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">FORCEINLINE float asm_rand </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a745ad91c072b53c792f1119644761e2f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">FORCEINLINE float asm_rand_max </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a711aca21b00164c4824b0bf58792aba7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ChangeFileNameToDDS </td>
          <td>(</td>
          <td class="paramtype">string &amp;&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a1cc6a4b6b03e91d140dcfb765a7c2533"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RandomDeviant </td>
          <td>(</td>
          <td class="paramtype">D3DXVECTOR3 &amp;&#160;</td>
          <td class="paramname"><em>result</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const D3DXVECTOR3 &amp;&#160;</td>
          <td class="paramname"><em>dir</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>fAngle</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>已知一向量和一角度定位的锥体，求穿过锥体顶点并位于锥体内的随机向量。 </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">dir</td><td>已知向量，锥体的轴 </td></tr>
    <tr><td class="paramname">fAngle</td><td>已知角度，轴到锥体某一边的弧度 </td></tr>
    <tr><td class="paramname">result</td><td>返回结果。穿过锥体顶点，并且位于锥体内的向量。</td></tr>
  </table>
  </dd>
</dl>
<p>求出粒子的发射方向等于该锥体内穿过发射器位置的一条射线。 </p>

</div>
</div>
<a class="anchor" id="a5e5a32131b529a419ed731bffcb50d97"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float RangeRandom </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>fLow</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>fHigh</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>随机值： fLow-fHigh </p>

</div>
</div>
<a class="anchor" id="afaa18e13379c2cfc10093b2cde5e4342"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float SymmetricRandom </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>随机值： (-1) - (1) </p>

</div>
</div>
<a class="anchor" id="a8222f6aabf6852a2ba89366555d849ca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float UnitRandom </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>随机值： 0-1 </p>

</div>
</div>
<a class="anchor" id="abd4f051b5c55f6a69432683d9bccca57"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">D3DXVECTOR3 Vec3Mutiply </td>
          <td>(</td>
          <td class="paramtype">const D3DXVECTOR3 &amp;&#160;</td>
          <td class="paramname"><em>v1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const D3DXVECTOR3 &amp;&#160;</td>
          <td class="paramname"><em>v2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>向量各分量相乘 </p>

</div>
</div>
<a class="anchor" id="a0fdabd0beb44a7b2c364177bb9821d6a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Vec3Perpendicular </td>
          <td>(</td>
          <td class="paramtype">D3DXVECTOR3 &amp;&#160;</td>
          <td class="paramname"><em>out</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const D3DXVECTOR3 &amp;&#160;</td>
          <td class="paramname"><em>src</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>求一个向量的“垂直”向量 </p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2018年 七月 1日 星期日 22:10:10 , 为 My Project使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
